<!--
 * @Description: 居中盒子
 * @Author: charles
 * @Date: 2021-08-17 19:05:52
 * @LastEditors: charles
 * @LastEditTime: 2021-08-17 19:10:06
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>居中盒子</title>
  <style>
    body {
      margin: 0;
    }
    .box {
      background-color: #f4f4f4;
    }
    .box > div {
      width: 100px;
      background-color: plum;
      margin-right: 10px;
      display: inline-block;
    }
    .box >div:nth-child(1){
      height: 100px;
    }
    .box >div:nth-child(2){
      height: 200px;
      vertical-align: top;
    }
    .box >div:nth-child(3){
      height: 300px;
      vertical-align: middle;

    }
  </style>
</head>
<body>
  <div class="box">
    <div></div>
    <div></div>
    <div></div>
    <span>sphinx</span>
  </div>
</body>
</html>
